package com.ibuonline.b2b.entity;

import java.io.Serializable;

public class SysUserRole implements Serializable {

	private static final long serialVersionUID = 5712991515443294152L;

	//fields
	private java.lang.Integer userId;
	private java.lang.Integer roleId;

	//default constructor
	public SysUserRole() {
	}

	//constructor with arguments
	public SysUserRole(java.lang.Integer roleId, java.lang.Integer userId) {
		this.roleId = roleId;
		this.userId = userId;
	}

	//getter
	public java.lang.Integer getUserId() {
		return userId;
	}
	public java.lang.Integer getRoleId() {
		return roleId;
	}

	//setter
	public void setUserId(java.lang.Integer userId) {
		this.userId = userId;
	}
	public void setRoleId(java.lang.Integer roleId) {
		this.roleId = roleId;
	}

	//equals method
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof SysUserRole))
			return false;

		final SysUserRole sysUserRole = (SysUserRole)other;
		if (!this.roleId.equals(sysUserRole.getRoleId()) || 
			!this.userId.equals(sysUserRole.getUserId()))
			return false;

		return true;
	}

	//hashCode method
	public int hashCode() {
		StringBuffer keys = new StringBuffer();
		keys.append(roleId).append(",");
		keys.append(userId).append(",");
		if (keys.length() > 0)
			keys.deleteCharAt(keys.length() - 1);
		return keys.toString().hashCode();
	}

	//toString method
	public String toString() {
		return new StringBuilder("SysUserRole[")
			.append("userId=").append(userId).append(", ")
			.append("roleId=").append(roleId).append("]").toString();
	}
}